
<!DOCTYPE HTML>
<script type="text/javascript">
    $(document).ready(function() {
        $( "#filter_bulan" ).change(function(){
                            location.href = "<?php echo PENJURU ?>grafik_harian_produk_jurusan/"+$('#filter_asal').val()+'/'+$('#filter_tujuan').val()+'/'+$('#filter_bulan').val()+"/"+$('#filter_tahun').val();
            });
            $( "#filter_asal" ).change(function(){
                            location.href = "<?php echo PENJURU ?>grafik_harian_produk_jurusan/"+$('#filter_asal').val()+'/'+$('#filter_tujuan').val()+'/'+$('#filter_bulan').val()+"/"+$('#filter_tahun').val();
            });
            $( "#filter_tujuan" ).change(function(){
                            location.href = "<?php echo PENJURU ?>grafik_harian_produk_jurusan/"+$('#filter_asal').val()+'/'+$('#filter_tujuan').val()+'/'+$('#filter_bulan').val()+"/"+$('#filter_tahun').val();
            });
            $( "#filter_tahun" ).change(function(){
                            location.href = "<?php echo PENJURU ?>grafik_harian_produk_jurusan/"+$('#filter_asal').val()+'/'+$('#filter_tujuan').val()+'/'+$('#filter_bulan').val()+"/"+$('#filter_tahun').val();
            });
        } );
    </script>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Highcharts Example</title>
		
		
		<!-- 1. Add these JavaScript inclusions in the head of your page -->
		<script type="text/javascript" src="<?php echo CHART ?>/highcharts.js"></script>
		
		<!-- 1a) Optional: add a theme file -->
		<!--
			<script type="text/javascript" src="../js/themes/gray.js"></script>
		-->
		
		<!-- 1b) Optional: the exporting module -->
		<script type="text/javascript" src="../js/modules/exporting.js"></script>
		
        <form action="">
                        Filter bulan : <?php echo form_dropdown('bulan', $bulan,$current['bulan'],'id="filter_bulan"')?>
			Filter asal : <?php echo form_dropdown('asal', $filter_asal['nama_cabang'],$current['asal'],'id="filter_asal"')?>
                        Filter tujuan : <?php echo form_dropdown('tujuan', $filter_tujuan['nama_cabang'],$current['tujuan'],'id="filter_tujuan"')?>
                        Filter tahun : <?php echo form_dropdown('tahun', $tahun,$current['tahun'],'id="filter_tahun"')?>
                        
                </form>
		<!-- 2. Add the JavaScript to initialize the chart on document ready -->
		<script type="text/javascript">
                    
		
			var chart;
			$(document).ready(function() {
				chart = new Highcharts.Chart({
					chart: {
						renderTo: 'container',
						defaultSeriesType: 'line',
						marginRight: 130,
						marginBottom: 25
					},
					title: {
						text: 'Grafik harian Produk Jurusan',
						x: -20 //center
					},
					subtitle: {
						text: '<?php echo $current['asal']."-".$current['tujuan'] ?>',
						x: -20
					},
					xAxis: {
						categories: [
                                                    <?php for($i=0;$i<$jumlah_hari;$i++){ 
                                                        if($i!=0)
                                                            echo ",";
                                                        echo "'".($i+1)."'";
                                                    }
?>
                                                   ]
					},
					yAxis: {
						title: {
							text: 'Jumlah'
						},
						plotLines: [{
							value: 0,
							width: 1,
							color: '#808080'
						}]
					},
					tooltip: {
						formatter: function() {
				                return '<b>'+ this.series.name +'</b><br/>'+
								this.x +': '+ this.y +' Orang';
						}
					},
					legend: {
						layout: 'vertical',
						align: 'right',
						verticalAlign: 'top',
						x: -10,
						y: 100,
						borderWidth: 0
					},
					series: [{
						name: 'Total Kapasitas',
						data: [<?php for($i=0;$i<$jumlah_hari;$i++){ 
                                                        if($i!=0)
                                                            echo ",";
                                                        if($grafik[$i]=='')
                                                        echo "0";
                                                        else
                                                            echo $grafik[$i]['total_kapasitas'];
                                                    }
?>]
					}, {
						name: 'Total Tiket',
						data: [<?php for($i=0;$i<$jumlah_hari;$i++){ 
                                                        if($i!=0)
                                                            echo ",";
                                                        if($grafik[$i]=='')
                                                        echo "0";
                                                        else
                                                            echo $grafik[$i]['total_penumpang'];
                                                    }
?>]
					}
                                        
                                        ]
				});
				
				
			});
				
		</script>
		
	</head>
	<body>
		
		<!-- 3. Add the container -->
		<div id="container" style="width: 800px; height: 400px; margin: 0 auto"></div>
		
				
	</body>
</html>
